package org.WhyMCA.WhyMCANews;

/**
@author Danilo '' Riso >> danilo DOT riso AT gmail DOT com
* @author Androidiani Dev Team
* @version 1.0
*/

import org.WhyMCA.Utils.Global;
import org.WhyMCA.Utils.PreferencesMgr;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.CompoundButton.OnCheckedChangeListener;

/**
 * Config menu activity class
 * @author danilo
 *
 */

public class CreditsActivity extends Activity {
		
		private TextView _appver;
		private PackageManager _packinfo;
		private static Intent _pintent;
		
		/** Called when the activity is first created. */
	    @Override
	    public void onCreate(Bundle savedInstanceState) {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.credits);
	        Global.setCtx(this);
	        createElements();
	        
	}
	    
	private void createElements() {
		
		_appver = (TextView) findViewById(R.id.TextViewCreditsAppVersion);
		try {
			_appver.setText(" V" + getPackageManager().getPackageInfo(this.getPackageName(), PackageManager.GET_META_DATA).versionName);
		} catch (NameNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
				
	}

	public static void setParentIntent(Intent intent) {
    	
    	_pintent = intent;
    	
    }
    
	public static Intent getParentIntent() {
    	
    	return _pintent;
    	
    }
	
	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		if (keyCode == KeyEvent.KEYCODE_BACK) {
		    // When the user center presses, let them pick a contact.
			this.finish();
			return true;
		}    
		return true;
	}
    
}
